import { defineComponent } from "vue";
import tsxDom from "@/tsx/vSlot";
const TsxDom = tsxDom;
export default defineComponent({
  setup() {
    type State = {
      name: string;
    };

    // 使用插槽
    const slots = {
      // default: () => <div>匿名插槽</div>,
      state: (state: State) => <div>{state.name}</div>,
      list: (list: number[]) => list.map((item) => <div>{item}</div>),
    };
    return () => (
      <>
        {/* 引用组件， 使用插槽：v-slots={slots} */}
        <TsxDom v-slots={slots} />
      </>
    );
  },
});
